package edu.ucla.cs.CalorieCounter;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper{
	private static final String DATABASE_NAME = "Trainers.db";
	
	public static final String NAME = "name";
	public static final String WEIGHT = "weight";  
	public static final String AGE = "age";
	public static final String GENDER = "gender";
	
	public static final String TABLE_NAME = "trainer";
	
	public DatabaseHelper(Context context){
		super(context, DATABASE_NAME, null, 1);
	}
	
	public void onCreate(SQLiteDatabase db){
		db.execSQL("CREATE TABLE trainer (_id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, weight REAL, age INT, gender INT);");
	}
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
		android.util.Log.v("Constants", "Upgrading database");
		db.execSQL("Drop table if exists");
		onCreate(db);
	}
}
